package com.service;

import com.dao.JobDao;
import com.pojo.Job;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class JobService {
    @Resource
    private JobDao dao;

    /*查询职位*/
    public List<Job> queryAll(int pageIndex, int pageSize){
        return dao.queryAll(pageIndex, pageSize);
    }
    /*添加职位*/
    public int addJob(Job job){
        return dao.addJob(job);
    }
    /*删除职位*/
    public int deleteJob(int id){
        return dao.deleteJob(id);
    }
    /*修改职位信息*/
    public int updateJob(Job job){
        return dao.updateJob(job);
    }
    /*根据ID查询职位*/
    public Job queryById( int id){
        return dao.queryById(id);
    }
    /*根据职位名称查询职位*/
    public List<Job> queryByName(int pageIndex,int pageSize,String name){
        return dao.queryByName(pageIndex, pageSize, name);
    }
    public int countAll(String name){
        return dao.countAll(name);
    }
}
